package com.mulanweb.api.module.controller;

import com.jfinal.plugin.activerecord.Page;
import com.mulanweb.api.module.model.City;
import com.mulanweb.api.module.model.Seller;
import com.mulanweb.api.module.model.Ticket;
import com.mulanweb.db.common.SQLGenerateHelper;
import com.mulanweb.validator.annotation.ValidateFile;
import com.mulanweb.validator.annotation.ValidateForm;

import java.util.Date;

/**
 * Created by Administrator on 2016/8/19.
 */
@ValidateFile
public class CityController extends BaseController {

    @ValidateForm
    public void search() {
        SQLGenerateHelper helper = new SQLGenerateHelper("city", "sequence");
        helper.addLikeCondition("name_cn", getPara("cityName"));
        helper.addIsNullCondition("delete_time");
        Page<City> page = City.dao.paginate(getPageNumber(), getPageSize(), helper.getSqlSelect(), helper.getSqlExceptSelect(), helper.getQueryParas());
        returnPageModelJson(page);
    }
}